/**
 * 
 */
package javango.db;

import java.util.List;

import org.apache.commons.logging.LogFactory;

public class QuerySetPage<T> extends AbstractPage<T> implements Page<T> {
	QuerySet<T> qs;
	public QuerySetPage(QuerySet<T> qs, int page, QuerySetPaginator<T> paginator) {
		super(page, paginator);
		this.qs = qs;
	}

	/**
	 * Returns the object list for this Page
	 * @return
	 */
	public List<? extends T> getObjectList() {
		try {
			return qs.list();
		} catch (ManagerException e) {
			//argg what should be done??
			// TODO
			LogFactory.getLog(QuerySetPage.class).error(e,e);
		}
		return null;
	}
	
	public QuerySet<? extends T> getQuerySet() {
		return qs;
	}
}